package leetcode.code1375;

public class Solution {
	public int numTimesAllBlue(int[] flips) {
		int max = -1, ans = 0;
		for (int i = 0; i < flips.length; i++) {
			max = Math.max(max, flips[i]);
			if (max == i + 1) {
				ans++;
			}
		}
		return ans;
	}
}
